home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root._currentframe != 3)
- {
- removeMovieClip(this);
- }
- if(_name != "arrowgen")
- {
- if(move == true)
- {
- _X = _X + run;
- _Y = _Y + rise;
- rise += 0.5;
- _rotation = Math.atan2(rise,run) * 180 / 3.141592653589793;
- if(_Y >= ground)
- {
- move = false;
- gotoAndStop(3);
- }
- for(i in _root.warriors)
- {
- if(_root.warriors[i].side == "right")
- {
- if(_root.warriors[i].hit.hitTest(_X,_Y,true) && _root.warriors[i].health > 0)
- {
- if(_root.moreDmg == false)
- {
- _root.warriors[i].health -= 4;
- }
- else
- {
- _root.warriors[i].health -= 5;
- }
- if(_root.warriors[i].health <= 0)
- {
- _root.money += 5;
- }
- stuck = true;
- move = false;
- tar = i;
- gotoAndStop(2);
- break;
- }
- if(_root.warriors[i].hitHead.hitTest(_X,_Y,true) && _root.warriors[i].health > 0)
- {
- _root.warriors[i].health -= 10;
- _root.money += 15;
- stuck = true;
- move = false;
- tar = i;
- gotoAndStop(2);
- break;
- }
- }
- }
- }
- else
- {
- _alpha = _alpha - 1;
- if(_alpha == 0)
- {
- removeMovieClip(this);
- }
- }
- if(stuck == true)
- {
- if(_root.warriors[tar].health <= 0)
- {
- removeMovieClip(this);
- }
- _X = _root.warriors[tar]._x;
- }
- }
- }
-